package com.rainy.micservice.provider.componet;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Order(1)
public class LogComponet {

    //声明切点类
    @Pointcut("execution(" +
            " * com.rainy.micservice.provider.action.DemoController.home())")
    private void controllerAspect(){}

    @Before(value = "controllerAspect()")
    public void methodBefore(){

        System.out.println("接下来要调用controller了");

    }

    @After(value = "controllerAspect()")
    public void aftermethod(){
        System.out.println("controller已经执行完毕。");
    }

}
